package com.luoying.itew.http.rxjava;

import com.google.gson.JsonObject;
import com.luoying.itew.bean.UpdateRBean;
import com.luoying.itew.bean.UserInfo;
import com.luoying.itew.http.BaseResponse;
import com.luoying.itew.http.HttpConfig;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * Created by lufan on 2019-04-24
 * Class describe
 */
public interface RxAppApi {

    /**
     * 地图相关信息
     *
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_MAP_INFO)
    Observable<BaseResponse<JsonObject>> userMapInfo(@FieldMap Map<String, Object> map);

    /**
     * 用户信息
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_INFO)
    Observable<BaseResponse<UserInfo>> userInfo(@FieldMap Map<String, Object> map);

    /**
     * 登录认证接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.USER_LOGIN)
    Observable<BaseResponse<Map>> userLogin(@FieldMap Map<String, Object> map);

    /**
     * 天气详情
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.WEATHER_INFO)
    Observable<BaseResponse<JsonObject>> getWeatherInfo(@FieldMap Map<String, Object> map);

    /**
     * 极光绑定
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.JIGUANG_BIND)
    Observable<BaseResponse<String>> jiguangBind(@FieldMap Map<String, Object> map);

    /**
     * 退出APP
     * @return
     */
    @FormUrlEncoded
    @POST(HttpConfig.BREAK_APP)
    Observable<BaseResponse<String>> breakApp(@FieldMap Map<String, Object> map, @Path("userId") int monitorPointId, @Path("flag") int flag);


    /**
     * 版本更新
     * @return
     */
    @POST(HttpConfig.UPDATE)
    Observable<BaseResponse<UpdateRBean>> update(@Body RequestBody body);




}
